/**
 * 
 */
package temp;

/**
 * @author Coddy created on 2010-5-8
 * 
 */
public class Temp
{

	/**
	 * @param args
	 */
	public static void main(String[] args)
	{
		String string = toFullBinaryString(24);
		System.out.println(string);
		System.out.println(string.charAt(0));
		System.out.println(string.charAt(3));
	}

	// System.out.println(Integer.toBinaryString(47));
	public static String toFullBinaryString(int num)
	{
		char[] chs = new char[Integer.SIZE];
		for (int i = 0; i < Integer.SIZE; i++)
		{
			chs[Integer.SIZE - 1 - i] = (char) (((num >> i) & 1) + '0');
			System.out.println(chs[Integer.SIZE - 1 - i]);
		}
		return new String(chs);
	}
}
